import moment from "moment";

export const paramsDataFormat = (params, needFormatKeys: string[], {pattern = 'YYYY-MM-DD HH:mm:ss'} = {}) =>{

  console.log('paramsDataFormat ',params)
  return  needFormatKeys.reduce((acc, key) =>
    ({...acc, [key]: moment(acc[key]).format(pattern)}), {...params})
}

